<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查找元素</title>
</head>
<body>
<script>
    var arr = ['tom','xiao','yu','hua'];
    for(var i in arr) {
        //
        console.log(i);
    }

    console.log(arr.index0f('tom'))
</script>
</body>
</html>